#ifndef XEGE_FONT
#define XEGE_FONT
#pragma once
// 其实文字处理，真的要有好多东西要学，这 TTF 库应该只是冰山一角
#include "xege.h"
// https://www.libsdl.org/projects/SDL_ttf/docs/SDL_ttf.html
namespace xege {
class FONT {
	TTF_Font* font;
public:


	FONT (std::string filepath = "D:/REPO/XEGE-SDL/test/res/msyahei.ttf", int size = 24);

	// UNICODE 转 UTF-8 编码(but to be honest, 2003 some organization limited the lenth of utf8 to 4 byte)
	//                          uncide 代码           存储 utf8 编码的字符串  字符串大小
	static int unicode2utf8(unsigned long unic, unsigned char *pOutput, int outSize);
	// 加载字体，暂不支持从系统中加载
	void loadFont (std::string filepath, int size = 24);
	// void loadFontIndex
// TTF_Font *TTF_OpenFontIndex(const char *file, int ptsize, long index)

	SDL_Surface* renderFontRF (
		std::string text = "oops, you haven't enter any words",
		color::RGBA F = {0xff, 0xff, 0xff, 0xff}
	);
	SDL_Surface* renderFontRF (
		unsigned char* text,
		color::RGBA F = {0xff, 0xff, 0xff, 0xff}
	);
	SDL_Surface* renderFontF (
		std::string text = "oops, you haven't enter any words",
		color::RGBA F = {0xff, 0xff, 0xff, 0xff},
		color::RGBA B = {0x00, 0x00, 0x00, 0xff}
	);
	SDL_Surface* renderFontF (
		unsigned char* text,
		color::RGBA F = {0xff, 0xff, 0xff, 0xff},
		color::RGBA B = {0x00, 0x00, 0x00, 0xff}
	);
	SDL_Surface* renderFont (
		std::string text = "oops, you haven't enter any words",
		color::RGBA F = {0xff, 0xff, 0xff, 0xff}
	);
	SDL_Surface* renderFont (
		unsigned char* text,
		color::RGBA F = {0xff, 0xff, 0xff, 0xff}
	);

	void setFontStyle ();
	void getFontStyle ();
	void setFontOutline ();
	void getFontOutline ();
	// FontHinting
	// FontKerning
	// FontHeight
	// FontAscent
	// FontDescent
	// FontLineSkip
	// FontFaces
	// FontFaceIsFixedWidth
	// FontFaceFamilyName
	// FontFaceStyleName
	// GlyphIsprovided
	// GlyphMetrics
	// SizeText
	// SizeUTF8
	// SizeUNICODE
	~FONT ();

};  // 类 FONT 结尾
}  // 命名空间 xege 结尾
#endif  // tb wf jm jx wz